#ifndef FS_WATCHER_HPP
#define FS_WATCHER_HPP

#include "config.h"

enum class FileSystemChangedReason {
    eCreated,   // 新建
    eDeleted,   // 删除
    eModified,  // 修改
    eRenamed,   // 重名
};

struct FileSystemChangedCallback {
    void  *user;
    void (*callback)(FileSystemChangedReason reason, const char *path[], void* user);
};

class DIARY_APP_SDK_API FileSystemWatcher final {
    class FileSystemWatcherImpl;
public:
    FileSystemWatcher();
    ~FileSystemWatcher();

    bool AddWatchFolder(const char *path)const;
    void SetCallback(FileSystemChangedCallback callback)const;
    void StartWatch ()const;
    void StopWatch () const;
private:
    FileSystemWatcherImpl *const d;
};

#endif /* FS_WATCHER_HPP */
